From: Tim Deegan Date: Wed, 25 Oct 2006 10:44:58 +0000 (+0100) Subject: [XEND] Be more generous with the default shadow allocation. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15584^2~31^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=3df1dee7fb6d63dc38eb293e799293f3992de154;p=xen.git [XEND] Be more generous with the default shadow allocation. Allow enough shadow memory to avoid thrashing the shadow pages, rather than just enough for safety. Signed-off-by: Tim Deegan --- diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 88a8a169bc..b3ed4417d2 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -500,9 +500,12 @@ class X86_HVM_ImageHandler(HVMImageHandler): # overhead due to getRequiredInitialReservation. maxmem_kb = self.getRequiredInitialReservation(maxmem_kb) - # 1MB per vcpu plus 4Kib/Mib of RAM. This is higher than - # the minimum that Xen would allocate if no value were given. - return max(1024 * self.vm.getVCpuCount() + maxmem_kb / 256, + # 256 pages (1MB) per vcpu, + # plus 1 page per MiB of RAM for the P2M map, + # plus 1 page per MiB of RAM to shadow the resident processes. + # This is higher than the minimum that Xen would allocate if no value + # were given (but the Xen minimum is for safety, not performance). + return max(4 * (256 * self.vm.getVCpuCount() + 2 * (maxmem_kb / 1024)), shadow_mem_kb)